package com.tj.collection.service.param;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.DateUtil;
import com.fqgj.exception.common.ApplicationException;

public class CollectionOverdueStatementParam extends ParamsObject {
    private Integer newOrOld;

    private String answerStartDate;

    private String answerEndDate;

    private String productType;


    @Override
    public void validate() {
        try {
            if (DateUtil.getDate(answerStartDate, "yyyy-MM-dd") == null || DateUtil.getDate(answerEndDate, "yyyy-MM-dd") == null) {
                throw new ApplicationException("参数校验失败");
            }
        } catch (Exception e) {
            throw new ApplicationException("参数校验失败");
        }

    }

    public Integer getNewOrOld() {
        return newOrOld;
    }

    public void setNewOrOld(Integer newOrOld) {
        this.newOrOld = newOrOld;
    }

    public String getAnswerStartDate() {
        return answerStartDate;
    }

    public  CollectionOverdueStatementParam setAnswerStartDate(String answerStartDate) {
        this.answerStartDate = answerStartDate;
        return this;
    }

    public String getAnswerEndDate() {
        return answerEndDate;
    }

    public  CollectionOverdueStatementParam setAnswerEndDate(String answerEndDate) {
        this.answerEndDate = answerEndDate;
        return this;
    }

    public String getProductType() {
        return productType;
    }

    public  CollectionOverdueStatementParam setProductType(String productType) {
        this.productType = productType;
        return this;
    }
}
